package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/19.
 * 回答类型，回答方式
 * @author wws
 */
public enum AnswerType implements CustomEnumType {

    ONE_TO_ONE("o", "单句回答"),
    MUTI_SESSION("m", "多轮会话");

    private AnswerType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, AnswerType> map = new HashMap<>();
    static {
        for (AnswerType value : AnswerType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static AnswerType fromValue(String value) {
        AnswerType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + AnswerType.class + "." + value);
        }
    }

}
